package com.atomci.javastarter.controller;

import com.alibaba.fastjson2.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloAtomController {

    class HelloObj{
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        private String name;
    }
    @RequestMapping(value = "/index", method = RequestMethod.GET)
    public String Index(){
        System.out.println("Hello AtomCI");
        HelloObj obj = new HelloObj();
        obj.setName("Hello AtomCI");
        return JSON.toJSON(obj).toString();
    }
}
